<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .outBox{
      width: 300px;
      height: 300px;
      overflow: auto;
    }
    .innerBox{
      width: 800px;
      height: 800px;
      background-color: bisque;
    }
  </style>
</head>
<body>
  <div class="outBox" id="box">
    <div class="innerBox">

    </div>
  </div>
</body>
<script>
  document.getElementById("box").addEventListener("scroll",function(e){
    console.log(e);
    let box=document.getElementById("box")
    let scrollHeight = box.scrollHeight;
    console.log("窗口可以滚动的距离",scrollHeight);
    let scrollTop=box.scrollTop
    console.log("已经滚动的近距离",scrollTop);
    let clientHeight=box.clientHeight;
    console.log("窗口本身的高度");
    
  })
</script>
</html>